Hi there,
I wanted to do a similar thing to my chat application. Josh was kind enough to point me to this forum from the main ubb one.
I have added a link at the top menu for users to click (for the chat module). The code that you guys describe here will be in a new PHP page, right? By including the main.inc.php one ensures that one has the use of functions/variables and with the full script one gets the user name and password.
What if I need to get some more information. Can I modify the authenticate() function to allow for another field to be used or will I have to hit the database again from this script?
Finally, I want this page to be launched in a new window and to execute an APPLET in it. I know how to do these things in ASP but as far as PHP is concerned I am in total darkness. There is a small java script that allows you to open a url (with any parameters) in a new window, so I can use that function.
I wish for the user to click on the chat link and a new window to open. This will ensure that the user has access to the forum. Once the new window opens, the checks are done and the applet initialized. I was thinking of the below php page:
code:
<?
// Require the library
require ("main.inc.php");
$userob = new user;
$user = $userob -> authenticate();
$Username = $user['U_Username'];
$RealEmail = $user['U_Email']; //Sorry I have to check the database for this one
$Name = $user['U_Name'];
$Homepage = $user['U_Homepage'];
$NewField = $user['U_NewField']; // A new field that I added for my chat application
Now here it becomes blurry. I want to execute the following:
code:
<APPLET NAME="MyChat"
CODEBASE="http://www.mydomain.com/Chat/Classes/"
CODE="another.new.class"
WIDTH="200"
HEIGHT="100"
ALIGN="MIDDLE"
ARCHIVE="something.jar">
<PARAM NAME="username" VALUE="$Username">
<PARAM NAME="name" VALUE="$Name">
<PARAM NAME="homepage" VALUE="$Homepage">
<PARAM NAME="realemail" VALUE='$RealEmail'>
<PARAM NAME="newfield" VALUE='$NewField'>
</APPLET>
Any help is more than appreciated.
Warm regards
Nikos